package com.hyjr.common.enums;

public enum StrengthLevelEnum {
	WEAK_PWD(1, "弱口令（不符合口令规则）"), EMPTY_PWD(2, "空口令"), 
	RISK_PWD(3, "风险口令（符合规则，但容易被猜解）"), CORRECT_PWD(4, "合规口令（符合规则，且不容易被猜解）");

	private Integer key;
	private String value;

	private StrengthLevelEnum(Integer key, String value) {
		this.key = key;
		this.value = value;
	}

	// 根据key获取枚举
	public static StrengthLevelEnum getEnumByKey(Integer key) {
		if (null == key) {
			return null;
		}
		for (StrengthLevelEnum temp : StrengthLevelEnum.values()) {
			if (temp.getKey().equals(key)) {
				return temp;
			}
		}
		return null;
	}

	public Integer getKey() {
		return key;
	}

	public String getValue() {
		return value;
	}
}
